import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "ChatSection",
    component: () => import(/* webpackChunkName: "Section" */ "@/views/chat/Section.vue"),
    meta: {
      keepAlive: true, // 是否缓存组件
    },
  },
  {
    path: "/user/login",
    name: "UserLogin",
    component: () => import(/* webpackChunkName: "Login" */ "@/views/user/Login.vue"),
    meta: {
      keepAlive: true, // 是否缓存组件
    },
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
